package com.example.basic.integer;

public class IntTest {
    public static void main(String[] args) {
        int number = 10;
        number = number + 20;
        System.out.println(number);

        // int 类型最大值
        int maxValue = Integer.MAX_VALUE;
        System.out.println("int 类型最大值: " + maxValue);
        // int 类型溢出
        System.out.println("int 类型最大值加1 : " + (maxValue + 1));
        System.out.println("int 类型溢出处理: " + (maxValue + 1L));

        int minValue = Integer.MIN_VALUE;
        System.out.println("int 类型最小值: " + minValue);
        // int 类型溢出
        System.out.println("int 类型最大值减1: " + (minValue - 1));
        System.out.println("int 类型溢出处理: " + (minValue - 1L));
    }
}
